<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>资源处理页面</title>
<meta http-equiv="pragma" content="no-cache">
<meta http-equiv="Cache-Control" content="no-cache, must-revalidate">
<meta http-equiv="expires" content="Wed, <!--{$smarty.now|date_format:'%e %B %Y %H:%M:%S'}--> GMT">
<script type="text/javascript" src="/j-tool/jquery.js"></script>
<link href='/public/css/admins.css' rel='stylesheet' type='text/css'/>
<body>
<div class='bread'>资源管理->资源处理</div>
<div class="manageBox">
	<div class="manageBox-div">
		<form action="" method="post" onsubmit="return false;" id="searchForm">
		<table class="searchBox">				
			<tr>
				<td>ID：</td><td><input type="text" name="id" class="input-text"/></td>
			</tr>
			<tr>
				<td>标题：</td><td><input type="text" name="title" class="input-text"/></td>
			</tr>
			<tr>
				<td>类型：</td>
				<td>
					<div id="sel" class="type-select">
						<div class="sel-box-value">
							<input type="hidden" name="cates" id="cates">
							<input type="text" name="sele-text" id="sele-text"><span class="sel-box-btn">搜索</span>
						</div>
						<ul>
						<!--{foreach from=$catename item=val key=key}-->
							<li data="<!--{$key}-->"><!--{$val}--></li>
						<!--{/foreach}-->
						</ul>							
					</div>	
				</td>
			</tr>
			<tr>
				<td>时间：</td><td><input type="text" name="sTime" class="input-text"/>&nbsp;--&nbsp;<input type="text" name="eTime" class="input-text"/></td>
			</tr>
			<tr height="35px;">
				<td><input type="hidden" name="action" value="getvalue"/></td>
				<td><input type="submit" value="搜索" onclick="search(1);" class="butt"/></td>
				<td>
					<div class="cutpage" style="width:650px;">
						<ul id="ajaxpage">
							<li class="caheTag"><span onclick="search(1);">1</span></li>
							<li><span onclick="search(2);">2</span></li>
							<li><span onclick="search(3);">3</span></li>
							<li><span onclick="search(4);">4</span></li>
							<li><span onclick="search(5);">5</span></li>
							<li><span onclick="search(6);">6</span></li>
							<li><span onclick="search(7);">7</span></li>
							<li><span onclick="search(8);">8</span></li>
							<li><span onclick="search(9);">9</span></li>
							<li><span onclick="search(10);">10</span></li>
							<li><span onclick="search(11);">11</span></li>
						</ul>
						<ul id="doline">
							<li>&nbsp;<button onclick="update(this);" class="butt">下载更新</button></li>
							<li>&nbsp;<button onclick="move('articles');" class="butt" style="width:101px;">To articles</button></li>
							<li>&nbsp;<button onclick="move('product');" class="butt" style="width:101px;">To product</button></li>
						</ul>
					</div>
				</td>
			</tr>				
		</table>
		</form>
	</div>
	<div class="content">
		<table id="sourceList">
			<tr><td>ID</td><td>标题</td><td>链接</td><td width="100">分类</td><td width="50">状态</td><td><a href="javascript:;" onclick="choseAll();">全选</a></td></tr>
			<!--{foreach from=$data item=val}-->
			<tr>
				<td><!--{$val.id}--></td>
				<td><!--{$val.name}--></td>
				<td><!--{$val.link}--></td>
				<td><!--{$catename[$val.cates]}--></td>
				<td><!--{$status[$val.step]}--></td>
				<td><input type="checkbox" name="chose[<!--{$val.id}-->]" value="<!--{$val.id}-->"/></td>
			</tr>
			<!--{/foreach}-->
		</table>			
		<div class="clear"></div>
	</div>
</div>
<script type="text/javascript" src="/j-tool/admins.js"></script>
</body>
<script>
	function move(to)
	{
		$.ajax({
		   type: "POST",
		   url: "admins_ajax.php",
		   data: 'action=movesource&to='+to+'&'+$("input:checked").serialize(),
		   success: function(msg){
				msg == 'OK'?alert("完成入库"):alert(msg);
				location.reload();
		   }
		});
	}

	function update(t)
	{
		$.ajax({
		   type: "POST",
		   url: "admins_ajax.php",
		   data: 'action=updatesource&'+$("input:checked").serialize(),
		   beforeSend:function(){
				$(t).text('正在下载').attr('disabled',true);
		   },
		   success: function(msg){
				msg == 'OK'?alert("更新完成"):alert(msg);
				$(t).text('下载更新').attr('disabled',false);
				location.reload();
		   }
		});
	}
</script>
</html>